{
g_irepository_prepend_search_path (MUTTER_TYPELIB_DIR);
- g_irepository_prepend_search_path (GNOME_SHELL_PKGLIBDIR);
+ g_irepository_prepend_search_path (SHELL_TYPELIB_DIR);
/* We need to explicitly add the directories where the private libraries are
* installed to the GIR's library path, so that they can be found at runtime
install_dir: bindir
)
+typelib_cflags = [
+ '-DMUTTER_TYPELIB_DIR="@0@"'.format(mutter_typelibdir),
+ '-DSHELL_TYPELIB_DIR="@0@"'.format(pkglibdir),
+]
+
gnome_shell_cflags = [
'-DCLUTTER_ENABLE_EXPERIMENTAL_API',
'-DCOGL_ENABLE_EXPERIMENTAL_API',
)
executable('gnome-shell', 'main.c',
- c_args: gnome_shell_cflags + [
- '-DMUTTER_TYPELIB_DIR="@0@"'.format(mutter_typelibdir)
- ],
+ c_args: gnome_shell_cflags + typelib_cflags,
dependencies: gnome_shell_deps + [libshell_dep, libst_dep, mutter_dep],
include_directories: [conf_inc, st_inc, include_directories('tray')],
build_rpath: mutter_typelibdir,
install: true
)
-executable('run-js-test', 'run-js-test.c',
+run_test = executable('run-js-test', 'run-js-test.c',
dependencies: [mutter_dep, mtk_dep, gdk_pixbuf_dep, gio_dep, gi_dep, gjs_dep],
+ c_args: typelib_cflags,
include_directories: [conf_inc],
link_with: libshell,
build_rpath: mutter_typelibdir,
global = shell_global_get ();
js_context = _shell_global_get_gjs_context (global);
+ g_irepository_prepend_search_path (MUTTER_TYPELIB_DIR);
+ g_irepository_prepend_search_path (SHELL_TYPELIB_DIR);
+
/* prepare command line arguments */
if (!gjs_context_define_string_array (js_context, "ARGV",
argc - 2, (const char**)argv + 2,
-testconf = configuration_data()
-testconf.set('MUTTER_TYPELIB_DIR', mutter_typelibdir)
-testconf.set('srcdir', meson.current_source_dir())
-run_test = configure_file(
- input: 'run-test.sh.in',
- output: 'run-test.sh',
- configuration: testconf
-)
-
mutter_tests_datadir = mutter_test_dep.get_variable('tests_datadir')
dbusrunnerconf = configuration_data()
dbusrunnerconf.set('MUTTER_TEST_PKGDATADIR', mutter_tests_datadir)
configuration: dbusrunnerconf,
)
+gvc_typelib_path = fs.parent(libgvc.get_variable('libgvc_gir')[1].full_path())
+shell_typelib_path = fs.parent(libshell_gir[1].full_path())
+st_typelib_path = fs.parent(libst_gir[1].full_path())
+
+unit_testenv = environment()
+unit_testenv.set('GNOME_SHELL_DATADIR', data_builddir)
+unit_testenv.append('GI_TYPELIB_PATH', gvc_typelib_path, separator: ':')
+unit_testenv.append('GI_TYPELIB_PATH', shell_typelib_path, separator: ':')
+unit_testenv.append('GI_TYPELIB_PATH', st_typelib_path, separator: ':')
+
unit_tests = [
'highlighter',
'injectionManager',
test(test, run_test,
args: 'unit/@0@.js'.format(test),
suite: 'unit',
+ env: unit_testenv,
workdir: meson.current_source_dir())
endforeach
},
]
-gvc_typelib_path = fs.parent(libgvc.get_variable('libgvc_gir')[1].full_path())
libgvc_path = fs.parent(libgvc.get_variable('libgvc').full_path())
background_file = join_paths(meson.current_source_dir(), 'data', 'background.png')
+++ /dev/null
-#!/bin/sh
-
-usage() {
- echo >&2 "Usage run-test.sh [-v|--verbose] <test_js>..."
- exit 1
-}
-
-tests=
-verbose=false
-debug=
-for arg in $@ ; do
- case $arg in
- -g|--debug)
- debug="libtool --mode=execute gdb --args"
- ;;
- -v|--verbose)
- verbose=true
- ;;
- -*)
- usage
- ;;
- *)
- tests="$tests $arg"
- ;;
- esac
-done
-
-builddir=`dirname $0`
-builddir=`cd $builddir && pwd`
-srcdir=@srcdir@
-srcdir=`cd $srcdir && pwd`
-
-GI_TYPELIB_PATH="$GI_TYPELIB_PATH${GI_TYPELIB_PATH:+:}@MUTTER_TYPELIB_DIR@:$builddir/../src:$builddir/../src/st:$builddir/../subprojects/gvc"
-GJS_PATH="$srcdir:$srcdir/../js:$builddir/../js"
-GJS_DEBUG_OUTPUT=stderr
-$verbose || GJS_DEBUG_TOPICS="JS ERROR;JS LOG"
-GNOME_SHELL_TESTSDIR="$srcdir/"
-GNOME_SHELL_JS="$srcdir/../js"
-GNOME_SHELL_DATADIR="$builddir/../data"
-
-export GI_TYPELIB_PATH GJS_PATH GJS_DEBUG_OUTPUT GJS_DEBUG_TOPICS GNOME_SHELL_TESTSDIR GNOME_SHELL_JS GNOME_SHELL_DATADIR LD_PRELOAD
-
-for test in $tests ; do
- $debug $builddir/../src/run-js-test $test || exit $?
-done